const http = require('request-promise-native')

async function requestHtml(url){
    let options = {
        uri:url,
        method :"GET"
    }
    let response = await http(options)
    return response
}

var baidu = requestHtml("http://www.baidu.com")

console.log("wait for baidu result")

console.log("here is>>>>>>>"+ (typeof baidu)+">>>" +(baidu instanceof Promise))

const rpa = require('request-promise-native');
var url = "https://www.baidu.com/";
async function useRequestPromiseAny(){
    let options = {
        method: 'GET',
        uri: url,
        auth : {
            'user' : 'xx',
            'pass' : 'xx',
            'sendImmediately' : 'false',
        }
      };
    let  rpabody = await rpa(options);       
    console.log("rpabody" , rpabody );
}

useRequestPromiseAny();